package com.zhengbing.tj.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.AllArgsConstructor;

import java.time.LocalDateTime;

/**
 * 角色实体类
 * 定义系统中的用户角色信息
 *
 * @author zhengbing
 * @date 2024-08-22
 */
@TableName("role")
@Api(tags = "角色")
@Data
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
@AllArgsConstructor
public class Role extends Model<Role> {
    /**
     * 角色ID
     */
    @ApiModelProperty(value = "角色ID", example = "123456789012345678")
    @TableId(type = IdType.ASSIGN_ID)
    private Long id;
    
    /**
     * 角色名称
     */
    @ApiModelProperty(value = "角色名称", example = "管理员")
    private String name;
    
    /**
     * 角色标识
     */
    @ApiModelProperty(value = "角色标识", example = "ADMIN")
    private String code;
    
    /**
     * 角色描述
     */
    @ApiModelProperty(value = "角色描述", example = "系统管理员，可以访问所有功能")
    private String description;
    
    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间")
    private LocalDateTime createTime;
    
    /**
     * 更新时间
     */
    @ApiModelProperty(value = "更新时间")
    private LocalDateTime updateTime;
    
    // 显式添加getter和setter方法以确保编译通过
    public Long getId() {
        return id;
    }
    
    public void setId(Long id) {
        this.id = id;
    }
    
    public String getName() {
        return name;
    }
    
    public void setName(String name) {
        this.name = name;
    }
    
    public String getCode() {
        return code;
    }
    
    public void setCode(String code) {
        this.code = code;
    }
    
    public String getDescription() {
        return description;
    }
    
    public void setDescription(String description) {
        this.description = description;
    }
    
    public LocalDateTime getCreateTime() {
        return createTime;
    }
    
    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }
    
    public LocalDateTime getUpdateTime() {
        return updateTime;
    }
    
    public void setUpdateTime(LocalDateTime updateTime) {
        this.updateTime = updateTime;
    }
}